<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>专业教学资源库</title>
<link href="css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jQuery/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jQuery/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/jQuery/jquery.metadata.js"></script>
<script type="text/javascript" src="js/jQuery/jquery.validate.message_cn.js"></script>
<script type="text/javascript" src="js/jQuery/formValidatorClass.js"></script> 
<!--  
<link href="css/validator.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/mootools.js" charset="gb2312"></script>
<script type="text/javascript" src="js/full-validator.js" charset="gb2312"></script>
-->
<style>
.bg{ background-color:#CCCCCC;}
.top_margin{ margin-top:50px;}
</style>
<script type="text/javascript">  
    function changeValidateCode(obj) {  
        //获取当前的时间作为参数，无具体意义  
        var timenow = new Date().getTime();  
        //每次请求需要一个不同的参数，否则可能会返回同样的验证码  
        //这和浏览器的缓存机制有关系，也可以把页面设置为不缓存，这样就不用这个参数了。  
        obj.src="rand.action?d="+timenow;  
    }
    
    $(document).ready(function() {
		//obj = document.getElementById("randImg");
    	//changeValidateCode(obj);
    	
		// 开始验证
		$('#demo').validate( {
			/* 设置验证规则 */
			rules : {
				"users.userName" : {
					required :true,
					stringCheck :true,
					byteRangeLength : [ 2, 60 ]
				},
				"users.password" : {
					required: true,
				//临时，需要修改为6！
	                    minlength: 1
				},
				"users.txtCheck" : {
					required :true,
					maxlength :6
				}
			},

			/* 设置错误信息 */
			messages : {
				"users.userName" : {
					required :"用户名不能为空",
					stringCheck :"用户名只能包括中文字、英文字母、数字和下划线",
					byteRangeLength :"用户名必须在1-60个字符之间(一个中文字算2个字符)"
				},
				"users.password" : {
					required :"密码不能为空",
					minlength:"密码最小长度为{0}个字符"
				},
				"users.txtCheck" : {
					required :"验证码不能为空",
					maxlength :"验证码必须为{0}个字符"
				}
			},

			/* 设置验证触发事件 */
			focusInvalid :false,
			onkeyup :false,

			/* 设置错误信息提示DOM */
			errorPlacement : function(error, element) {
				error.appendTo(element.parent());
			}

		});
    });
</script> 

</head>

<body class="bg">
<table width="950" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="207" align="center"><img src="images/default_01.jpg" width="950" height="207" /></td>
  </tr>
</table>
<table width="950" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="502" align="right" valign="top" bgcolor="#FFFFFF"><div class="top_margin"><img src="images/default_07.gif" width="283" height="87" /></div></td>
    <td width="26"><img src="images/default_03.gif" width="26" height="303" /></td>
    <td width="422" align="left" valign="top" bgcolor="#FFFFFF" style=" background-image:url(images/default_04.gif); background-repeat:no-repeat;">
    <form name="login" action="Users/login.action" method="post" id="demo">
    <table width="303" border="0" cellpadding="0" cellspacing="0" style=" margin-top:60px;">
      <tr>
        <td width="74" height="30" align="right">用户名：</td>
        <td width="229"><input type="text" name="users.userName" id="users.userName" style="width:130px;"/>
        </td>
      </tr>
      <tr>
        <td height="30" align="right">密码：</td>
        <td><input type="password" name="users.password" id="users.password" style="width:130px;"/>
        </td>
      </tr>
      <tr>
        <td height="30" align="right">用户类型：</td>
        <td><input type="radio" name="users.userType" id="admin" checked="checked" class="no_border" value="admin"/>管理员  <input type="radio" name="users.userType" id="stu" class="no_border" value="stu"/>学生</td>
      </tr>
      <!--<tr>
        <td height="30" align="right">验证码：</td>
        <td><input type="text" name="users.txtCheck" id="users.txtCheck" size="6"/><img src="rand.action" onclick="changeValidateCode(this)" id="randImg"/></td>
      </tr>
      <tr>
        <td height="30" align="right"></td>
        <td>如验证码失效，请点击图片进行更换</td>
      </tr>
      -->
      <tr>
        <td height="30">&nbsp;</td>
        <td><input type="submit" name="button" id="button" value="" style=" background-image: url(images/default_11.gif); height:22px; width:59px; border:0px; padding:0px;"/></td>
      </tr>
    </table>
    </form>
    </td>
  </tr>
</table>
<table width="950" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="100" align="center" bgcolor="#FFFFFF">CopyRight 2011 </td>
  </tr>
</table>
</body>
</html>